@extends('layouts.back_stage')
@section('content')
    <link rel="stylesheet" href="{{env('CDN_DOMAIN_NAME')}}/css/createPro.css?v=1.0.2">
    <script src="{{env('CDN_DOMAIN_NAME')}}/js/commonjs/jquery.select.js"></script>
    <script>
        //颜色
        var colors = [
            <?php $j = count($colors_arr);$i = 0; ?>
                    @foreach ($colors_arr as $k=>$v )
                '{{$v["color_name"]}}'<?php $i++;?> @if($i<$j),@endif
            @endforeach
        ];
    </script>
    <div class="container">
        <div class="row">
            <div style="margin:30px;"><h3 >修改商品资料</h3></div>
            <div style="width:90%;margin-left:100px;">
                <div class="form-group"><h3 >基本信息</h3></div>
                <div class="form-group">
                    <ul class="form_ul">
                        <li class="form_li"><span class="xing">*</span>大分类：
                            <select class="sel_inp inp1">
                                @if($info->cate1)
                                    <option value="{{ $info->cate1 }}"> {{ $categorys[$info->cate1] }}</option>
                                @else
                                    <option value="">请选择</option>
                                @endif
                                @foreach($category as $k=>$v)
                                    <option value="{{ $k }}">{{ $v }}</option>
                                @endforeach
                            </select>
                        </li>
                        <li class="form_li"><span class="xing">*</span>中分类：
                            <select class="sel_inp inp2">
                                @if($info->cate2)
                                    <option value="{{ $info->cate2 }}"> {{ $categorys[$info->cate2] }}</option>
                                @else
                                    <option value="">请选择</option>
                                @endif
                            </select>
                        </li>
                        <li class="form_li"><span class="xing">*</span>小分类：
                            <select class="sel_inp inp3">
                                @if($info->cate3)
                                    <option value="{{ $info->cate3 }}"> {{ $categorys[$info->cate3] }}</option>
                                @else
                                    <option value="">请选择</option>
                                @endif
                            </select>
                        </li>
                    </ul>
                    <ul class="form_ul">
                        <li class="form_li"><span class="xing">*</span>品牌：
                            <select class="sel_inp inp4">
                                @if($info->brand)
                                <option value="{{ $info->brand }}">{{ $brand[$info->brand] }}</option>
                                @else
                                <option value="">请选择</option>
                                @endif
                                    @foreach($brand as $k=>$v)
                                        <option value="{{ $k }}">{{ $v }}</option>
                                    @endforeach
                            </select>
                        </li>
                        <li class="form_li"><span class="xing">*</span>年份：
                            <select class="sel_inp inp5">
                                @if($info->year)
                                    <option value="{{ $info->year }}">{{ $info->year }}</option>
                                @else
                                    <option value="">请选择</option>
                                @endif
                                <option value="2016">2016</option>
                                <option value="2017">2017</option>
                                <option value="2018">2018</option>
                                <option value="2019">2019</option>
                                <option value="2020">2020</option>
                            </select>
                        </li>
                        <li class="form_li"><span class="xing">*</span>季节：
                            <select class="sel_inp inp6">
                                <option value="{{$info->quarter}}">{{$info->quarter}}</option>
                                <option value="">请选择</option>
                                <option value="春季">春季</option>
                                <option value="夏季">夏季</option>
                                <option value="秋季">秋季</option>
                                <option value="冬季">冬季</option>
                            </select>
                        </li>
                        <li class="form_li" style="width:215px;"><span class="xing">*</span>销售季节：
                            <select class="sel_inp inp7">
                                <option value="">请选择</option>
                                @foreach($season as $k=>$v)
                                    <option value="{{ $v}}"
                                            @if($info->sale_quarter ==$v)
                                            selected
                                            @endif
                                    >{{ $v }}</option>
                                @endforeach
                            </select>
                        </li>
                    </ul>
                    <ul class="form_ul">
                        <li class="form_li"><span class="xing">*</span>款号：<input class="form_inp inp8" maxlength="12" value="{{ $info->girard }}" type="text" autocomplete="off" autocorrect="off" placeholder="款号" /></li>
                        <li class="form_li"><span class="xing">*</span>零售价：<input class="form_inp inp9" maxlength="7" value="{{ $info->retail_price }}" type="text" autocomplete="off" autocorrect="off" placeholder="零售价" /></li>
                        <li class="form_li"><span class="xing">*</span>单位：
                            <select class="sel_inp inp10">

                                <option value="{{$info->unit}}">{{$info->unit}}</option>
                                <option value="">请选择</option>
                                <option value="件">件</option>
                                <option value="双">双</option>
                                <option value="个">个</option>
                                <option value="条">条</option>
                                <option value="顶">顶</option>
                            </select>
                        </li>
                        <li class="form_li" style="width:215px;"><span class="xing">*</span>品名：<input class="form_inp inp11" style="width:155px;" maxlength="10" value="{{ $info->name }}" type="text" autocomplete="off" autocorrect="off" placeholder="品名" /></li>
                    </ul>
                </div>
                <div class="form-group"><h3 >尺码规格</h3></div>
                <div class="form-group">
                    <div style="width:195px;line-height:30px;float:left;">
                        <span class="xing">*</span>尺码组：
                        <select class="sel_inp inp12">

                            <option value="{{$info->size_group}}">{{ $info->size_group }}</option>
                            <option value="">请选择</option>
                            <option  value="服装">服装(5-17码)</option>
                            <option value="服装">服装(3-17码)</option>
                            <option value="鞋帽">鞋帽</option>
                            <option value="大人鞋帽">大人鞋帽</option>
                            <option value="小童服装">小童服装</option>
                            <option value="其他">其他</option>
                        </select>
                    </div>
                    <button type="button" class="plus">+</button>
                    <button type="button" class="minus">-</button>
                </div>
                <div class="form-group">
                    <ul class="size_ul">
                        <li class="size_lis"><span class="xing">*</span>尺码：</li>
                        @if(count($size) > 0)
                            @foreach($size as $k=>$v)
                                <li class='size_li'><input readonly type='text' class='sizes' value="{{ $v }}"></li>
                            @endforeach
                        @endif
                        @php($size_price = explode(',',$info->size_price))
                    </ul>
                    <ul class="money_ul">
                        <li class="money_lis"><span class="xing">*</span>价格：</li>
                        @foreach($size_price as $v)
                            <li class='money_li'><input readonly type='text' class='moneys' value="{{ $v }}"></li>
                        @endforeach
                    </ul>
                </div>
                <div class="form-group"><h3>颜色信息</h3></div>
                <div class="form-group">
                    <ul class="form_ul">
                        <li style="float:left;line-height:30px;margin-right:9px;"><span class="xing">*</span>颜色：</li>

                            <span class="color_span" style="float:left;">
                         @if(count($color_arr)>0)
                            @for($i=0;$i<count($color_arr);$i++)
                                <input id="colorInput{{$i}}" value="{{$color_arr[$i]}}" class="form_inp inpColor" type="text" autocomplete="off" autocorrect="off" name="color[]" id="" placeholder="颜色"/>
                            @endfor
                         @endif
                            </span>
                        <button type="button" class="btn btn-primary addBTN">+</button>
                        <button type="button" class="btn btn-primary delBTN">-</button>

                    </ul>
                </div>
                <div class="form-group"><button type='button' class='form_add btn btn-success'>保存</button></div>
            </div>
        </div>
    </div>
    <script>
        var product_id='{{ $_GET['id'] }}';
        for(var v=0;v<$(".inpColor").length;v++){
            $.selectSuggest('colorInput'+v, colors);
        }
    </script>
    <script src="{{env('CDN_DOMAIN_NAME')}}/js/createPro.js?v=1.0.5"></script>
@endsection
